package cn.edu.scau.dropship.mapper;

import cn.edu.scau.dropship.entity.Finance_check;
import cn.edu.scau.dropship.entity.Finance_checkExample;
import java.util.Date;
import java.util.List;
import org.apache.ibatis.annotations.Arg;
import org.apache.ibatis.annotations.ConstructorArgs;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface Finance_checkMapper {
    @SelectProvider(type=Finance_checkSqlProvider.class, method="countByExample")
    long countByExample(Finance_checkExample example);

    @DeleteProvider(type=Finance_checkSqlProvider.class, method="deleteByExample")
    int deleteByExample(Finance_checkExample example);

    @Delete({
        "delete from finance_check",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into finance_check (id, type, ",
        "money, apply_time, ",
        "state, admin_id)",
        "values (#{id,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, ",
        "#{money,jdbcType=DOUBLE}, #{applyTime,jdbcType=TIMESTAMP}, ",
        "#{state,jdbcType=VARCHAR}, #{adminId,jdbcType=INTEGER})"
    })
    int insert(Finance_check record);

    @InsertProvider(type=Finance_checkSqlProvider.class, method="insertSelective")
    int insertSelective(Finance_check record);

    @SelectProvider(type=Finance_checkSqlProvider.class, method="selectByExample")
    @ConstructorArgs({
        @Arg(column="id", javaType=Integer.class, jdbcType=JdbcType.INTEGER, id=true),
        @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR),
        @Arg(column="money", javaType=Double.class, jdbcType=JdbcType.DOUBLE),
        @Arg(column="apply_time", javaType=Date.class, jdbcType=JdbcType.TIMESTAMP),
        @Arg(column="state", javaType=String.class, jdbcType=JdbcType.VARCHAR),
        @Arg(column="admin_id", javaType=Integer.class, jdbcType=JdbcType.INTEGER)
    })
    List<Finance_check> selectByExample(Finance_checkExample example);

    @Select({
        "select",
        "id, type, money, apply_time, state, admin_id",
        "from finance_check",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ConstructorArgs({
        @Arg(column="id", javaType=Integer.class, jdbcType=JdbcType.INTEGER, id=true),
        @Arg(column="type", javaType=String.class, jdbcType=JdbcType.VARCHAR),
        @Arg(column="money", javaType=Double.class, jdbcType=JdbcType.DOUBLE),
        @Arg(column="apply_time", javaType=Date.class, jdbcType=JdbcType.TIMESTAMP),
        @Arg(column="state", javaType=String.class, jdbcType=JdbcType.VARCHAR),
        @Arg(column="admin_id", javaType=Integer.class, jdbcType=JdbcType.INTEGER)
    })
    Finance_check selectByPrimaryKey(Integer id);

    @UpdateProvider(type=Finance_checkSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Finance_check record, @Param("example") Finance_checkExample example);

    @UpdateProvider(type=Finance_checkSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Finance_check record, @Param("example") Finance_checkExample example);

    @UpdateProvider(type=Finance_checkSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Finance_check record);

    @Update({
        "update finance_check",
        "set type = #{type,jdbcType=VARCHAR},",
          "money = #{money,jdbcType=DOUBLE},",
          "apply_time = #{applyTime,jdbcType=TIMESTAMP},",
          "state = #{state,jdbcType=VARCHAR},",
          "admin_id = #{adminId,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Finance_check record);
}